package com.book.common.config;

import java.io.IOException;
import java.util.Properties;

/**
 * Description：
 * @Author： leo.xiong
 * @CreateDate： 2019/07/05 15:54
 * @Email： leo.xiong@suyun360.com
 * Version：1.0
 */
public class PropertiesConfig {

    private static Properties properties = null;

    public static Properties getProperties() {
        try {
            properties.load(PropertiesConfig.class.getClassLoader().getResourceAsStream("application.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }

    public final static String getValue(String key) {
        if (properties == null) {
            properties = new Properties();
            getProperties();
        }
        return properties.getProperty(key);
    }
}
